from django.conf.urls import url

from apps.users import views
from apps.users.views import UsernameCountView, LoginView, LogoutView, UserCenterView, UserInfoView, UserPasswordView, \
    AddressView

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),

    url(r'^usernames/(?P<username>[a-zA-Z0-9_]{5,20})/count/$', UsernameCountView.as_view(), name='count'),

    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),

    url(r'^usercenter$', UserCenterView.as_view(), name='usercenter'),  # 用户中心
    url(r'^userinfo$', UserInfoView.as_view(), name='userinfo'),  # 个人信息
    url(r'^userpassword$', UserPasswordView.as_view(), name='userpassword'),  # 修改密码

    url(r'^address/$', AddressView.as_view(), name='address'),

    url(r'^updateaddress/$', views.UpdateDestroyAddressView.as_view(), name='updateaddress'),

    url(r'^update1address/$', views.UpdateAddressView.as_view(), name='update1address'),
]
